import { defineStore } from "pinia";
import { ref } from 'vue'
import { getWebSiteInfo } from '@/api/frontend/other'

export const useWebSiteInfoStore = defineStore('websiteinfo', () => {
  // 网站信息
  const webSiteInfo = ref({})

  // 获取网站信息方法
  const getWebSiteInfos = async () => {
    // 调用后台获取网站信息接口
    const res = await getWebSiteInfo()
    if (res.success) {
      webSiteInfo.value = res.data
    }
  }

  return { webSiteInfo, getWebSiteInfos }
})